home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-28 | 1.7 KB | 83 lines | [TEXT/MPS ] |
- *
- * Utility routines for the LDAP DSAM.
- *
- * Written by: Gavin Eadie
- * The University of Michigan Computing Center
- * 535 West William, Ann Arbor, Michigan 48103-4943
- * Phone: (313) 936-0816
- * AppleLink: A67
- * Internet: Gavin.Eadie@umich.edu
- *
- * History: Oct22/91 - Started (Gav)
- * Sep13/92 - Improved for DSAM etc (Gav)
- * Apr13/93 - corrected bzero bug ... (Gav)
- *
-
- Case Object
-
- Print OFF
-
- Include 'Traps.a'
- Include 'SysEqu.a'
-
- Load 'ProgStrucMacs.d'
- Load 'FlowCtlMacs.d'
-
- Print ON
-
-
- ***********************************************************************
- *
- * void io_Complete(CntrlParam *);
- *
- * performs the I/O completion handling on an IOP.
- *
-
- A5_Save EQU 18 ; offset to saved A5 in PB
-
- Export Procedure io_Complete(PB:L,Err:L),C,LINK=DEBUG
-
- Begin Save=D0-D1/A0-A1
-
- Move.L PB(FP),A0 ; get PB
- Move.L Err(FP),D0 ; get Err
-
- Move.W D0,ioResult(A0) ; set ioResult in PB
- Move.L ioCompletion(A0),D1 ; check if I/O completion routine
- If# NZ Then.S
- Move.L A5,-(SP) ; save it for the duration
- Move.L A5_Save(A0),A5
- Link A6,#0 ; make a stack frame
- Move.L A0,-(SP) ; push PB for C call
- Move.L D1,A1
- Tst.W D0 ; clear zero condition flag
- Jsr (A1) ; call completion routine
- Unlk A6 ; clean out the stack
- Move.L (SP)+,A5
- EndIf#
-
- Return
-
-
- ***********************************************************************
- *
- * void bzero(void * , long);
- *
- * Clear a block of memory.
- *
-
- Export Procedure bzero(ptr:L, len:L),C,LINK=DEBUG
-
- Begin
-
- Move.L ptr(FP),A0 ; pointer to target region
- Move.L len(FP),D0 ; and its length in bytes
- Bra.S @20
-
- @10 Clr.B (A0)+ ; clear a byte
- @20 Dbra D0, @10
-
- Return
-
- End
-